import Request from './Request';
import {Congress, Director, President} from './Handlers';
import separator from '../patternSeparator';

separator('责任链模式');
// 各责任人
let dir = new Director();
let prd = new President();
let meeting = new Congress();
// 设置责任链
dir.setSuccessor(prd);
prd.setSuccessor(meeting);

// 设置不同待处理金额
let buyTable = new Request(5);
dir.handleRequest(buyTable);
let buyComputer = new Request(800);
dir.handleRequest(buyComputer);
let buyCompany = new Request(99999);
dir.handleRequest(buyCompany);